From f534560d7eb14551088358d9547ce3277c4271a1 Mon Sep 17 00:00:00 2001 From: Nathanael Jones Date: Mon, 6 Feb 2017 16:11:46 -0700 Subject: [PATCH] Add (non-deterministically) failing test for #3658 --- tests/build-script.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/build-script.rs b/tests/build-script.rs index 74297a86e..1b56d0632 100644 --- a/tests/build-script.rs +++ b/tests/build-script.rs @@ -1781,6 +1781,46 @@ fn changing_an_override_invalidates() { ")); } +#[test] +fn fresh_builds_possible_with_overrides() { + // The bug is non-deterministic. Sometimes you can get a fresh build + let target = rustc_host(); + let p = project("foo") + .file("Cargo.toml", r#" + [project] + name = "foo" + version = "0.5.0" + authors = [] + links = "foo" + build = "build.rs" + "#) + .file("src/lib.rs", "") + .file(".cargo/config", &format!(" + [target.{}.foo] + rustc-link-lib = [\"foo\"] + rustc-cfg=[\"ossl102\"] + version = \"102\" + conf = \"\" + ", target)) + .file("build.rs", ""); + + assert_that(p.cargo_process("build").arg("-v"), + execs().with_status(0).with_stderr("\ +[COMPILING] foo v0.5.0 ([..] +[RUNNING] `rustc [..] -l foo` +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +")); + + sleep_ms(2000); + + assert_that(p.cargo("build").arg("-v"), + execs().with_status(0).with_stderr("\ +[FRESH] foo v0.5.0 ([..]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +")); +} + + #[test] fn rebuild_only_on_explicit_paths() { let p = project("a") -- 2.30.2